#ifndef PLAYER_PROFILE_H
#define PLAYER_PROFILE_H

#include <stdio.h>

#include <common.h>



struct GameStatistic {
	int wins;
	int loses;
	int dotsWin;
	int dotsLost;
	int dots;
	int totalDotsWin;
	int totalDotsLost;
	int timePlayed;
	int totalTimePlayed;
};

struct PlayerProfile {
	int id;
	char * name;
	char * passwd;
	void * userPic;
	size_t userPicSize;
	int color;
	GameStatistic stat;
	void readFromFile (FILE * f);
	void writeToFile (FILE * f);
};


struct RatingItem {
	int place; //deprecated, DONT USE
	char * name;
	GameStatistic stat;
	void readFromFile (FILE * f);
	void writeToFile (FILE * f);
	RatingItem() {
		//TRACE ("RatingItem %p", this);
	}
	~RatingItem () {
		//TRACE ("~RatingItem %p", this);
	}
};

struct Rating {
	RatingItem items[10];
	int itemCount;
	bool readFromFile (const char * filename);
	bool writeToFile (const char * filename);
};

#endif /* !PLAYER_PROFILE_H */